package org.example.study.sc.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.study.sc.entity.GoodsStock;
import org.example.study.sc.entity.OrderItem;
import org.example.study.sc.mapper.OrderItemMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: rabbitmq-study
 * @description:
 * @Version V1.0.0
 * @author: dazhi
 * @create: 2021-02-03 17:27
 **/
@Service
public class OrderItemService extends ServiceImpl<OrderItemMapper, OrderItem> {

    public List<OrderItem> getByOrderId(Long orderId) {
        QueryWrapper<OrderItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(OrderItem::getOrderId, orderId);
        return super.list(queryWrapper);
    }

}
